<template>
    <div>
    <div style="padding:20px;">
      <div class="show">
        <div class="picture" :style="'backgroundImage:url('+headerImage+')'"></div>
      </div>
      <div style="margin-top:20px;">
        <input type="file" id="upload" accept="image/jpg" @change="upload">
        <label for="upload"></label>
      </div>
    </div>
  </div>
</template>
<script>
  export default {
     name: 'Admin',
    data(){
      return{
        name:"herry"
      }
    },
  // beforeRouteEnter:(to,from,next)=>{
  //     //alert("hello"+this.name);
  //     next(vm=>{
  //       alert(vm.$store.state.userInfo.userAccount);
  //     });
  //   },
    beforeRouteLeave:(to,from,next)=>{
      //alert("hello"+this.name);

         if(confirm("确定离开吗？"))
         {
           next();
         }
         else
         {
           next(false);
         }

    },
    methods:{
       upload (e) {
       }
    }
  }
</script>
<style scoped>
*{
  margin: 0;
  padding: 0;
}
.show {
  width: 100px;
  height: 100px;
  overflow: hidden;
  position: relative;
  border-radius: 50%;
  border: 1px solid #d5d5d5;
}
.picture {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
}
</style>
